package com.quanquan.user.repository;

import com.quanquan.user.entity.MarketingRules;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 功能描述:
 *
 * @ClassName: MarketingRulesRepository
 * @Author: xiaoqianh丶
 * @Date: 2019-05-24 16:40
 * @Version: V1.0
 */
public interface MarketingRulesRepository extends JpaRepository<MarketingRules, String>, JpaSpecificationExecutor<MarketingRules> {

    /**
     * 查详情
     * @param id
     * @return
     */
    @Query(value = "select * from oo_marketing_rule where id = ?1",nativeQuery = true)
    MarketingRules findByRuleId(String id);

    /**
     * 查所有规则
     * @param
     * @return
     */
    @Query(value = "select * from oo_marketing_rule",nativeQuery = true)
    List<MarketingRules> findAlls();
}
